package com.example.myspringboot.design.singleton;

/**
 * @Author ZhengShan
 * @Date 2024 06 24 14 09
 **/
public class SingletonLocakDemo {

    private volatile static SingletonLocakDemo singletonLocak;

    private SingletonLocakDemo(){
    }

    public static SingletonLocakDemo getInstance(){
        if(singletonLocak == null){
            synchronized (SingletonDazyDemo.class){
                if(singletonLocak == null) {
                    singletonLocak = new SingletonLocakDemo();
                }
            }
        }
        return singletonLocak;
    }
}
